/**
 * @author loongnoy
 * @version 1.0
 * @created 06-5��-2025 14:42:59
 */
public class ComponentDecorator extends VisualComponent {

    protected VisualComponent component; // 持有被装饰对象的引用

    public ComponentDecorator(VisualComponent visualComponent) {
        this.component = visualComponent;
    }

    @Override
    public void display() {
        if (component != null) {
            component.display(); // 调用被装饰对象的 display 方法
        }
    }
}